﻿/**
 * Reboulder - Partial Boulder Dash clone
 * Jesús Sagra, 2014
 * 
 * HiScoreScreen class: shows highest scores
 * 
 * Version    Date     Changes
 * -----------------------------------------------------
 *  0.01   06-mar-2015  Draw
 */

class HiScoresScreen
{
    protected Font font18;

    public HiScoresScreen()
    {
        font18 = new Font("data/Joystix.ttf", 18);
    }


    public void Draw()
    {
        HiScores myHiScores = new HiScores();
        
        SdlHardware.ClearScreen();
        short y = 200;
        for (byte i = 0; i < myHiScores.scores.Length; i++)
        {
            SdlHardware.WriteHiddenText(
                myHiScores.scores[i].place + "   " +
                myHiScores.scores[i].name + "   " +
                myHiScores.scores[i].points,
                400, y, 255, 255, 255, font18);
            y += 30;
        }
        SdlHardware.WriteHiddenText("PRESS ESC TO SKIP",
            400, 600, 255, 255, 255, font18);
        SdlHardware.ShowHiddenScreen();
        
        do
        {
            SdlHardware.Pause(40);
        }
        while (!SdlHardware.KeyPressed(SdlHardware.KEY_ESC));
    }
}